//package com.amigo.online.provider.search.rocketmq.consumer;
//
//import java.util.ArrayList;
//import java.util.List;
//
//import javax.annotation.Resource;
//
//import org.apache.solr.client.solrj.SolrClient;
//import org.apache.solr.common.SolrDocument;
//import org.apache.solr.common.SolrInputDocument;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.stereotype.Component;
//
//import com.amigo.online.common.param.result.UserInfo;
//import com.amigo.online.provider.search.rocketmq.PushMessage;
//import com.amigo.online.provider.search.rocketmq.model.BaseMqSendModel;
//@Component("UserEditToSolrConsumer")
//public class UserEditToSolrConsumer implements PushMessage{
//	private static final Logger log = LoggerFactory.getLogger(UserEditToSolrConsumer.class);
//	@Resource(name="SolrClient_user") 
//	private SolrClient serverurl_user;
//	@Resource(name="SolrClient_video") 
//	private SolrClient solrClient_video;
//	@Override
//	public void handleMessage(BaseMqSendModel baseMqSendModel) throws Exception {
//		log.info("用户编辑消费开始。。");
//		UserInfo userInfo = baseMqSendModel.getSendContentBean(UserInfo.class);
//		log.info("userInfo数据为"+userInfo.toString());
//		//4、为文档添加域
//		SolrInputDocument document = new SolrInputDocument();
//		List<SolrInputDocument> doc2=new ArrayList<SolrInputDocument>();
//		SolrDocument doc = serverurl_user.getById(userInfo.getId()+"");
//		document.addField("id", doc.get("id")+"");//id
//		document.addField("account", doc.get("account")+"");//amigo账号
//		document.addField("email", doc.get("email")==null?"":doc.get("email")+"");//emai
//		//document.addField("mobilephone", doc.get("mobilephone")==null?"":doc.get("mobilephone")+"");//手机号
//		//document.addField("twitter_open_id", userInfo.get+"");//twitterid
//		//document.addField("facebook_open_id", userInf+"");//
//		//document.addField("wechat_open_id", userInfo.getw+"");//推荐
//		document.addField("country", doc.get("country")==null?"":doc.get("country")+"");//国家
//		document.addField("city", doc.get("city")==null?"":doc.get("city")+"");//城市
//		document.addField("sign", doc.get("sign")==null?"":doc.get("sign")+"");//签名
//		document.addField("background", doc.get("background")==null?"":doc.get("background")+"");//背景图片
//		//document.addField("secret", userInfo.gets+"");//是否可见:0所有人可见，1好友可见，2所有人不可见
//		document.addField("nickname", userInfo.getNickname()==null?"":userInfo.getNickname()+"");//昵称
//		document.addField("sex", userInfo.getSex()==null?"":userInfo.getSex()+"");//性别
//		document.addField("avatar", userInfo.getAvatar()==null?"":userInfo.getAvatar()+"");//头像
//		document.addField("birthday",userInfo.getBirthday()==null?System.currentTimeMillis()/1000-569203200:userInfo.getBirthday());
//		document.addField("mobilephone", userInfo.getMobilephone()==null?"":userInfo.getMobilephone()+"");//手机号
//	    /*SolrQuery query = new SolrQuery();
//	    StringBuffer fqSB = new StringBuffer(); 
//	    fqSB.append("user_id:").append(doc.get("id")+"");
//	    query.addFilterQuery(fqSB.toString());
//	    QueryResponse query2 = solrClient_video.query(query);
//	    SolrDocumentList results = query2.getResults();
//	    SolrInputDocument document1 = new SolrInputDocument();
//		List<SolrInputDocument> doc3=new ArrayList<SolrInputDocument>();
//	    for(SolrDocument sd:results){
//	    	sd.replace("nickname_user", userInfo.getNickname()+"");
//	    	sd.replace("avatar_user", userInfo.getAvatar());
//	    }
//	    solrClient_video.add(docs)*/	
//		doc2.add(document);
//		serverurl_user.add(doc2);
//		serverurl_user.commit();
//		log.info("用户编辑消费结束进入solr。。");
//	}
//
//}
